First step to network infrastructure, add a type to XenDomain to identify
authorstekloff@dyn9047022152.beaverton.ibm.com <stekloff@dyn9047022152.beaverton.ibm.com>
Thu, 4 May 2006 13:20:11 +0000 (14:20 +0100)
committerstekloff@dyn9047022152.beaverton.ibm.com <stekloff@dyn9047022152.beaverton.ibm.com>
Thu, 4 May 2006 13:20:11 +0000 (14:20 +0100)
it as HVM or PV rather than using the config time option. The forthcoming
XenNetDevice will need to check. This is also the first step toward running
PV and HVM domains at the same time.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
tools/xm-test/lib/XmTestLib/XenDomain.py

index 1779d459ae319a21526a6974e389e3fe6ba08e85..d13037f0fef12a14db464e490164f43fdefa25a8 100644 (file)
@@ -193,6 +193,12 @@ class XenDomain:
             self.name = getUniqueName()
 
         self.config = config
+        # Set domain type, either PV for ParaVirt domU or HVM for 
+        # FullVirt domain
+        if ENABLE_HVM_SUPPORT:
+            self.type = "HVM"
+        else:
+            self.type = "PV"
 
     def start(self):
 
@@ -203,6 +209,10 @@ class XenDomain:
                               extra=output,
                               errorcode=ret)
 
+        # HVM domains require waiting for boot
+        if self.getDomainType() == "HVM":
+            waitForBoot()
+
     def stop(self):
         prog = "xm"
         cmd = " shutdown "
@@ -225,6 +235,9 @@ class XenDomain:
     def getId(self):
         return domid(self.getName());
 
+    def getDomainType(self):
+        return self.type
+
 
 class XmTestDomain(XenDomain):
 
@@ -246,11 +259,6 @@ class XmTestDomain(XenDomain):
 
         XenDomain.__init__(self, config.getOpt("name"), config=config)
 
-    def start(self):
-        XenDomain.start(self)
-        if ENABLE_HVM_SUPPORT:
-            waitForBoot()
-
     def minSafeMem(self):
         return 32